Skip to content

Conversation

@bobbinth
Copy link
Contributor

This PR re-organizes crate exports. The main changes are:

  • Moved most STARK-related exports under the stark module.
  • Removed algebraic_sponge module from the public interface.
  • Moved test_utils module under rand module.
  • Moved a few other functions around.
  • Updated the README file.

@bobbinth bobbinth added the no changelog This PR does not require an entry in the `CHANGELOG.md` file label Dec 28, 2025

## STARK proving system

The STARK module exports foundational components for the STARK proving system. It primarily consists of re-exports from the [Plonky3](https://github.com/Plonky3/Plonky3) project with some Miden-specific [adaptations](https://github.com/0xMiden/p3-miden).
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should expand this quite a bit in the future. Let's add it to the list of follow-ups.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few possible additional re-exports were mentioned here:
#720 (comment)

But the re-exports we have as of 7ba721b are rather extensive.

Comment on lines +29 to +55
pub mod stark {
//! Foundational components for the STARK proving system based on Plonky3.
//!
//! This module contains components needed to build a STARK prover/verifier and define
//! Algebraic Intermediate Representation (AIR) for the Miden VM and other components.
//! It primarily consists of re-exports from the Plonky3 project with some Miden-specific
//! adaptations.
pub use p3_miden_prover::{
Commitments, Domain, Entry, OpenedValues, PackedChallenge, PackedVal, PcsError, Proof,
ProverConstraintFolder, StarkConfig, StarkGenericConfig, SymbolicAirBuilder,
SymbolicExpression, SymbolicVariable, Val, VerificationError, VerifierConstraintFolder,
generate_logup_trace, get_log_quotient_degree, get_max_constraint_degree,
get_symbolic_constraints, prove, quotient_values, recompose_quotient_from_chunks, verify,
verify_constraints,
};

pub mod air {
pub use p3_air::{
Air, AirBuilder, AirBuilderWithPublicValues, BaseAir, BaseAirWithPublicValues,
ExtensionBuilder, FilteredAirBuilder, PairBuilder, PairCol, PermutationAirBuilder,
VirtualPairCol,
};
pub use p3_miden_air::{
BaseAirWithAuxTrace, FilteredMidenAirBuilder, MidenAir, MidenAirBuilder,
};
}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is my stab at how I think the module should be organized, but we can change this later in case another structure is more logical.

Also, same as last comment: we should expand this in the future to provide a more comprehensive explanation of what this module is and how the provided functionality is different from stock Plonky3. This would include adding comments for the air submodule and to many structs/functions here that are currently missing comments. Let's note this in the same issue.

@bobbinth
Copy link
Contributor Author

In the last commit, I've also grouped FF-related re-exports under the field module and moved zeroize re-export under utils.

get_symbolic_constraints, prove, quotient_values, recompose_quotient_from_chunks, verify,
verify_constraints,
};
pub use p3_miden_goldilocks::Goldilocks as Felt;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the longer run, I wonder if we should create a newtype for this - i.e.:

pub struct Felt(p3_miden_goldilocks::Goldilocks);

And implement a bunch of "pass-through" methods in it directly so that we don't have to import various traits when we need to get specific functionality.

Copy link
Contributor

@huitseeker huitseeker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't export RpoPermutation256 and RpxPermutation256, which are needed to construct hashers, compressors, and challengers in miden-vm. I might need other modifications, investigating.

@bobbinth
Copy link
Contributor Author

This doesn't export RpoPermutation256 and RpxPermutation256, which are needed to construct hashers, compressors, and challengers in miden-vm. I might need other modifications, investigating.

Fixed!

@huitseeker huitseeker self-requested a review December 28, 2025 21:56
Copy link
Contributor

@huitseeker huitseeker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bobbinth bobbinth merged commit 66fdcff into next Dec 28, 2025
27 checks passed
@bobbinth bobbinth deleted the bobbin-crate-exports branch December 28, 2025 22:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no changelog This PR does not require an entry in the `CHANGELOG.md` file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants